<?php

class Back_Form_Pages extends Jnd_Form
{

    public function __construct ($decorateur = "Formulairejndpro", $options = null)
    {
        if (isset($options["utilisateurs"])) {
            $this->_utilisateurs = $options['utilisateurs'];
        }
        parent::__construct($decorateur, $options);
        $this->setElementDecorators(
                array(
                        "$decorateur"
                ), array(), false);
    }

    public function init ()
    {
        $this->setAction('/back/pages/editer');
        $this->setName("news");
        $this->setMethod("post");
        $this->addAttribs(
                array(
                        "class" => "cssform"
                ));
        
        $champ = new Zend_Form_Element_Hidden("id");
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("titre");
        $champ->setLabel(__("Titre"));
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Radio("menu");
        $champ->setLabel(__("Dans le menu ?"));
        $champ->setDescription(
                __('Indiquer si la page doit apparaitre dans le menu'));
        $champ->setMultiOptions(array(
                "0" => __("non"),
                "1" => __("oui")
        ));
        $champs[] = $champ;
        
        $champ = new Jnd_Form_Element_AdvancedTextarea("contenu");
        $champ->setLabel(__("Contenu"));
        $champs[] = $champ;
        
        $this->addElements($champs);
    }
}

